package com.net.xpay.common.domain.partner;

import com.net.common.domain.CommonDomain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * 2020/9/3 15:15

 * 合伙人安全付佣金统计记录
 */
@Getter
@Setter
@NoArgsConstructor
public class PartnerSafePaySettleRecord extends CommonDomain {

    @ApiModelProperty(notes = "合伙人id")
    private Long partnerId;

    @ApiModelProperty(notes = "日期")
    private LocalDate day;

    @ApiModelProperty(notes = "总分佣 分")
    private Long benefit;

    @ApiModelProperty(notes = "一级分佣 分")
    private Long levelOneBenefit;

    @ApiModelProperty(notes = "二级分佣 分")
    private Long levelTwoBenefit;

    @ApiModelProperty(notes = "成功总笔数")
    private Long successCount;

    @ApiModelProperty(notes = "成功总金额")
    private BigDecimal successAmount;

    @ApiModelProperty(notes = "成功转账客户数")
    private Long transUserCount;

    @ApiModelProperty(notes = "一级成功笔数")
    private Long levelOneSuccessCount;

    @ApiModelProperty(notes = "二级成功笔数")
    private Long levelTwoSuccessCount;

    @ApiModelProperty(notes = "是否已结算")
    private Boolean settled;

    public static PartnerSafePaySettleRecord getInstance(LocalDate day, Long partnerId) {
        PartnerSafePaySettleRecord instance = new PartnerSafePaySettleRecord();
        instance.setPartnerId(partnerId);
        instance.setDay(day);
        instance.setBenefit(0L);
        instance.setLevelOneBenefit(0L);
        instance.setLevelTwoBenefit(0L);
        instance.setSuccessCount(0L);
        instance.setSuccessAmount(new BigDecimal("0.00"));
        instance.setTransUserCount(0L);
        instance.setLevelOneSuccessCount(0L);
        instance.setLevelTwoSuccessCount(0L);
        instance.setSettled(false);
        return instance;
    }
}
